﻿using Microsoft.AspNetCore.Http;
using Simple.Repository.Models.ClassRoom;
using Simple.Repository.Models.Slideshow;

namespace Simple.Services;

public class SlideshowOutputModel : ModelBase
{
    /// <summary>
    /// 主键ID
    /// </summary>
    public Guid? Id { get; set; } = null;

    /// <summary>
    /// 标题
    /// </summary>
    public string Title { get; set; } = "";

    /// <summary>
    /// 来源 1-内部，2-外部
    /// </summary>
    public int Source { get; set; } = 1;

    /// <summary>
    /// 来源1-内部(文章-1或课程-2类别)
    /// </summary>
    public int? SourceType { get; set; } = null;

    /// <summary>
    ///2-外部(http地址)
    /// </summary>
    public string HttpURL { get; set; } = "";

    /// <summary>
    /// 1-内部（文章Id或课程Id）
    /// </summary>
    public Guid? ObjectId { get; set; } = null;

    /// <summary>
    /// 排序
    /// </summary>
    public int SortValue { get; set; }

    /// <summary>
    /// 是否可见
    /// </summary>
    public bool IsShow { get; set; } = true;

    /// <summary>
    /// 显示区域1-家长，2-园务
    /// </summary>
    public string? ShowRange { get; set; } = "";

    /// <summary>
    /// 图片集合
    /// </summary>
    public SlideshowManageImage? Image { get; set; } = null;

    /// <summary>
    /// 链接内容
    /// </summary>
    public string ContentTitle { get; set; } = "";

    /// <summary>
    /// 发布时间
    /// </summary>
    public DateTime? CreatedTime { get; set; }

    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<SlideshowManage, SlideshowOutputModel>();

        profile.CreateMap<SlideshowOutputModel, SlideshowManage>();
    }
}

public class InternalResourcesOutputModel
{
    public int Key { get; set; }

    public string Name { get; set; }

    public List<InternalResourcesDto> Values { get; set; }
}

public class InternalResourcesDto
{
    public Guid? Key { get; set; }

    public string Value { get; set; }
}
